
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    response.setHeader("Cache-Control","no-store");
    response.setHeader("Pragrma","no-cache");
    response.setDateHeader("Expires",0);
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <%@include file="head.jsp"%>
    <script type="text/javascript" src="../static/js/head.js"></script>

</head>
<body>



<table id="queryTable"></table>

</body>
</html>
<jsp:include page="template.jsp" flush="true">
    <jsp:param name="test1" value="xx"/>
</jsp:include>

<script type="text/javascript" src="../static/js/adp2.js"></script>
<script type="text/javascript">
    var adptable = $("#queryTable").adpTable({
        service: "User",
        method: "list",
        enableCheckbox: true,
        columns: [
            {field: 'name', title: '名称', width: 180},
            {field: 'password', title: '密码', width: 80},
            {
                field: 'locked', title: '是否激活', width: 100, field: function (i, obj) {
                return obj.locked ? "是" : "否";
            }
            },
            {
                field: 'url', title: '拥有角色', field: function (i, obj) {
                if (obj.roles)
                    return obj.roles.map(function (item) {
                        return item.roleName;
                    }).join(",");

                return '未绑定角色';
            }
            },
            {
                title: '操作', width: 220, field: function () {
                return '<button ADP_BTN ADP_ICON="update" method="updateEntity">更新</button>' +
                    '<button ADP_BTN ADP_ICON="delete" method="deleteEntity">删除</button>'
                    ;
            }
            }
        ]
    });
    adptable.load({name:""});
</script>